// A DSL is a mini "language" embedded in a Rust macro. It is completely valid Rust because the macro system expands into normal Rust constructs, but it looks like a small language. This allows you to define concise or intuitive syntax for some special functionality (within bounds).
// DSL是一种嵌入在Rust宏中的迷你“语言”。
// 它是完全有效的Rust，因为宏系统扩展为正常的Rust构造，但它看起来像一种小语言。
// 这使您能够为某些特殊功能（在范围内）定义简洁或直观的语法。

macro_rules! calculate {
    (eval $e:expr) => {
        {
            // 表达式会直接被求值
            let val: usize = $e; // Force types to be unsigned integers
            println!("{} = {}", stringify!{$e}, val);
        }
    };
}

fn main() {
    calculate! {
        eval 1 + 2 // hehehe `eval` is _not_ a Rust keyword!
    }

    calculate! {
        eval (1 + 2) * (3 / 4)
    }
}